﻿using System;
using System.Collections.Generic;

namespace SmartSpace.Silverlight
{
    public class SlNavigation
    {
        /// <summary>
        /// 获取或设置编号
        /// </summary>
        public Guid ID { get; set; }

        /// <summary>
        /// 获取或设置名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 获取或设置导航对应的图标编号
        /// </summary>
        public string IconID { get; set; }

        /// <summary>
        /// 获取或设置导航对应的图标路径
        /// </summary>
        public string IconPath { get; set; }

        public int Order { get; set; }

        public Guid ApplicationID { get; set; }

        /// <summary>
        /// 获取或设置子节点
        /// </summary>
        public List<SlNavigation> Children { get; set; }

        //public bool IsAuthorized { get; set; }

        public SlNavigateView View { get; set; }

        public SlNavigation()
        {
            Children = new List<SlNavigation>();
        }
    }

    public class SlNavigateView
    {
        public Guid ModuleID { get; set; }
        public Guid ViewID { get; set; }
        /// <summary>
        /// 视图参数
        /// </summary>
        public string ViewArguments { get; set; }

        public List<SlNavigatieViewAction> Actions { get; set; }

        public SlNavigateView(Guid moduleID, Guid viewID)
        {
            ModuleID = moduleID;
            ViewID = viewID;
            Actions = new List<SlNavigatieViewAction>();
        }
    }

    public class SlNavigatieViewAction
    {
        public Guid ID { get; set; }
        public bool IsAuthorized { get; set; }
        public SlNavigatieViewAction(Guid actionID, bool isAuthorized)
        {
            ID = actionID;
            IsAuthorized = isAuthorized;
        }
    }
}
